package com.zsj;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;

/**
 * 启动SpringBoot项目
 * 
 * @author Zsj
 *
 */
//此注解指定这是一个SpringBoot的应用程序，不加就会报异常 Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
@SpringBootApplication(scanBasePackages = {"com.zsj"})
@MapperScan(basePackages = {"com.zsj.dao"})
//此注解后Servlet、Filter、Listener可以直接通过@WebServerlet、@WebFilter、@WebListener注解自动注册，无需其他代码
@ServletComponentScan
//既想使用security又不想每次输入用户名密码，可以直接在Application文件中禁用自动配置
//？注：启动security配置后，无法成功登录进入Druid Monitor Web监控统计功能界面
@EnableAutoConfiguration(exclude = {
	org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
})
public class Application {

	public static void main(String[] args) {
		//SpringApplication用于从main方法中启动Spring应用的类
        SpringApplication.run(Application.class, args);
        
        //SpringApplication application = new SpringApplication(Application.class);
        //Spring启动标识,如果不想要，可以设置取消
        //application.setBannerMode(Mode.OFF);
        //application.run(args);
	}
}

